import SafariServices
import FlutterMacOS

class MyPlugin {
    static func register(_ flutterViewController: FlutterViewController) {
        FlutterMethodChannel(name: "MyPlugin", binaryMessenger: flutterViewController.engine.binaryMessenger).setMethodCallHandler { methodCall, result in
            let arguments = methodCall.arguments as? NSDictionary
            switch methodCall.method {
            case "getMsg":
                result("欢迎使用YFree_App：macos")
            case "goH5":
                let alert = NSAlert()
                alert.messageText = "当前尚不支持"
                alert.runModal()
            case "goUniapp":
                let alert = NSAlert()
                alert.messageText = "当前尚不支持"
                alert.runModal()
            default: result(FlutterMethodNotImplemented)
            }
        }
    }
}
